﻿namespace EFS.Common
{
	public class CurrentUser
	{
		/// Property CurrentLoggedInUser: Get
		public static System.Security.Principal.WindowsIdentity CurrentLoggedInUser
		{
			get
			{
				return System.Security.Principal.WindowsIdentity.GetCurrent();
			}
		}

		/// Property CurrentLoggedInUserName: Get
		public static System.String CurrentLoggedInUserName
		{
			get
			{
				// get
				System.Security.Principal.WindowsIdentity currentLoggedInUser = CurrentLoggedInUser;
				if (null != currentLoggedInUser)
				{
					return currentLoggedInUser.Name.Split('\\')[1];
				}

				// none
				return null;
			}
		}
	}

}